#include<stdio.h>
#include<stdlib.h>
#define MAXSIZE 100
#define OK 1
#define OVERFLOW -1
#define ERROR 0;
typedef char QElemType;
typedef int Status;

typedef struct{
    QElemType *base;
    int front;
    int rear;
}SqQueue;

Status InitQueue(SqQueue*Q){
    Q->base=(QElemType*)malloc(MAXSIZE*sizeof(QElemType));
    if(!Q->base)exit(OVERFLOW);
    Q->front=Q->rear=0;
    return OK;
}

Status EnQueue(SqQueue*Q,QElemType e)
{
    if(Q->front==(Q->rear+1)%MAXSIZE)
    return ERROR;
    Q->base[Q->rear]=e;
    Q->rear=(Q->rear+1)%MAXSIZE;
    return OK;
}

Status DeQueue(SqQueue*Q,QElemType*e)
{
    if(Q->front==Q->rear)
    return ERROR;
    *e=Q->base[Q->front];
    Q->front=(Q->front+1)%MAXSIZE;
    return OK;
}

int QueueLength(SqQueue Q)
{
    return (Q.rear-Q.front+MAXSIZE)%MAXSIZE;
}

int main()
{
    SqQueue Q;
    char e;
    InitQueue(&Q);
    printf("Input the string");
    while(1)
    {
        scanf("%c",&e);
        if(e=='#');
        break;
        EnQueue(&Q,e);
    }
}